package me.xiaoyan.ehr.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.index.Indexed;

import java.io.Serializable;

/**
 * 员工实体类
 */
@RedisHash("login_employee")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("employee")
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class Employee extends BaseEntity implements Serializable {
    @TableId(type = IdType.AUTO)
    @Id
    private Integer id;
    @TableField("emp_id")
    @Indexed
    private String empId;
    private String name;
    @TableField("id_card_number")
    private String idCardNumber;
    @TableField("type_id")
    private Integer typeId;
    @TableField(exist = false)
    private EmployeeType type;
    @TableField(exist = false)
    private Job job;
    @TableField("job_id")
    private Integer jobId;
    /**
     * 头像
     */
    @TableField("head_image")
    private String headImage;
    /**
     * 员工状态(1.在职 2:实习 3:离职 4:辞退)
     */
    @TableField("emp_status")
    private Integer empStatus;
    @TableField("major")
    private String major;
    @TableField("high_degree")
    private String highDegree;
    /**
     * 员工基本信息
     */
    @TableField(exist = false)
    public EmployeeInfo employeeInfo;
}
